<!--
 * @Author: zxh
 * @Email: 1271027008@qq.com
 * @Date: 2020-03-10 10:27:53
 * @Descripttion: 审批出入库管理
 -->
<div class="examine_approve_container">
    <div nz-row nzGutter="10" class="row_1" style="padding: 10px 0;">
        <div nz-col nzSpan="4" class="operate_btn">
            <button nz-button nzType="" [disabled]="approvalDisabled" (click)="approval()" style="margin-right: 6px;"
                [class]="approvalDisabled?'ant-btn ant-btn-primary defaultBg disabledBg':'ant-btn ant-btn-primary defaultBg'">
                审批</button>
            <button nz-button nzType="" [disabled]="approvalInfoDisabled" (click)="detail()"
                [class]="approvalInfoDisabled?'ant-btn ant-btn-primary defaultBg disabledBg':'ant-btn ant-btn-primary defaultBg'">
                明细</button>
        </div>
        <div nz-col nzSpan="4">
            <label style="width: 15%;">申请编码：</label>
            <input nz-input placeholder="输入申请编码" [(ngModel)]="ApplyCode" appHotSearch
                (hotSearchEmit)="GetSearchPageList()" style="width: 60%;"/>
        </div>
        <div nz-col nzSpan="4">
            <label style="width: 15%;">申请人：</label>
            <input nz-input placeholder="输入申请人" [(ngModel)]="ApplyUser" appHotSearch
                (hotSearchEmit)="GetSearchPageList()" style="width: 60%;"/>
        </div>
        <div nz-col nzSpan="4">
            <label>审批状态：</label>
            <nz-select nzDropdownClassName="select_custom" class="select_term" [(ngModel)]="statusList" (ngModelChange)="selectedStatusList($event)" >
                <nz-option nzValue="1,2,3,4,5" nzLabel="请选择"></nz-option>
                <nz-option nzValue="1" nzLabel="待审核"></nz-option>
                <nz-option nzValue="2" nzLabel="已通过"></nz-option>
                <nz-option nzValue="3" nzLabel="被拒绝"></nz-option>
                <nz-option nzValue="4" nzLabel="管理员退回"></nz-option>
                <nz-option nzValue="5" nzLabel="审批中"></nz-option>
                <!-- <nz-option *ngFor="let item of wareInStateList" [nzValue]="item.key" [nzLabel]="item.value">
                </nz-option> -->
            </nz-select>
        </div>
        <div nz-col nzSpan="4">
            <label>单据类别：</label>
            <nz-select nzDropdownClassName="select_custom" class="select_term" nz-col [(ngModel)]="searchType" [nzSize]="100" nzPlaceHolder="单据类别"
                (ngModelChange)="selectedType($event)">
                <nz-option nzValue="" nzLabel="请选择"></nz-option>
                <nz-option nzValue="1" nzLabel="入库单"></nz-option>
                <nz-option nzValue="2" nzLabel="出库单"></nz-option>
            </nz-select>
        </div>
        <div nz-col nzSpan="4">
            <label>单据类型：</label>
            <nz-select nzDropdownClassName="select_custom" class="select_term" [(ngModel)]="DocumentType" (ngModelChange)="selectedDocumentType($event)">
                <nz-option nzValue="" nzLabel="请选择"></nz-option>
                <nz-option *ngFor="let item of MaterialInBillTypeEnum" [nzValue]="item.key" [nzLabel]="item.value">
                </nz-option>
            </nz-select>
        </div>
    </div>
    <div nz-row class="row_2">
        <nz-table #expandTable [nzData]="listData" [nzFrontPagination]="false" [nzBordered]="true"  nzSize="small">
            <thead>
                <tr>
                    <th nzShowCheckbox [(nzChecked)]="isAllChecked" [nzIndeterminate]="isIndeterminate"
                        (nzCheckedChange)="checkAll($event)"></th>
                    <th>序号</th>
                    <th>申请编码</th>
                    <th>单据类别</th>
                    <th>单据类型</th>
                    <th>申请时间</th>
                    <th>申请人</th>
                    <th>最后审批时间</th>
                    <th>最后审批人</th>
                    <th>审批状态</th>
                    <th>出库状态</th>
                    <th>备注</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of expandTable.data;index as i " class="tbodyData ant-table-row ng-star-inserted">
                    <td nzShowCheckbox [(nzChecked)]="data.checked" [nzDisabled]="data.disabled"
                        (nzCheckedChange)="SelectRow()">
                    </td>
                    <td>{{ i+1 }}</td>
                    <td>{{ data.code }}</td>
                    <td>{{ data.typeStr }}</td>
                    <td>{{ data.billTypeStr }}</td>
                    <td>{{ data.reqDate }}</td>
                    <td>{{ data.createByName }}</td>
                    <td>{{ data.lastApprovalDate }}</td>
                    <td>{{ data.lastApproverName }}</td>
                    <td>{{ data.statusTypeStr}}</td>
                    <td>{{ data.inoutStatusStr}}</td>
                    <td>{{ data.remarks }}</td>
                </tr>
            </tbody>
        </nz-table>
        <div nz-row class="row_4" *ngIf="expandTable.data.length!=0" style="text-align: right;padding-top: 10px;">
            <nz-pagination (nzPageIndexChange)="clickPage($event)" (nzPageSizeChange)="clickSize($event)"
                [(nzPageIndex)]="pageIndex" [nzTotal]="totalSize" [nzShowTotal]="totalTemplate"></nz-pagination>
            <ng-template #totalTemplate let-total> 总共 {{totalSize}} 条 </ng-template>
        </div>
    </div>
</div>